import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import ConvertView from '../views/ConvertView.vue'
import CompressView from '../views/CompressView.vue'
import SeparateView from '../views/SeparateView.vue'
import WatermarkView from '../views/WatermarkView.vue'
import EditorView from '../views/EditorView.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/convert'
  },
  {
    path: '/convert',
    name: 'convert',
    component: ConvertView,
    meta: {
      title: '格式转换',
      icon: '🔄'
    }
  },
  {
    path: '/compress',
    name: 'compress',
    component: CompressView,
    meta: {
      title: '视频压缩',
      icon: '📦'
    }
  },
  {
    path: '/separate',
    name: 'separate',
    component: SeparateView,
    meta: {
      title: '音视频分离',
      icon: '✂️'
    }
  },
  {
    path: '/watermark',
    name: 'watermark',
    component: WatermarkView,
    meta: {
      title: '水印处理',
      icon: '💧'
    }
  },
  {
    path: '/editor',
    name: 'editor',
    component: EditorView,
    meta: {
      title: '视频编辑',
      icon: '✏️'
    }
  }
]

const router = createRouter({
  // 使用 hash 模式，适合 Electron 应用
  history: createWebHashHistory(),
  routes
})

export default router
